package com.anhtuan.reminder.dialogs;

import com.anhtuan.reminder.R;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

public class DeleteWarningDialog extends DialogFragment {
	private DialogInterface.OnClickListener positiveButtonOnClickListener = null;
	private DialogInterface.OnClickListener nagativeButtonOnClickListener = null;
	
	public void setPositiveButtonOnClickListener(DialogInterface.OnClickListener onClickListener) {
		this.positiveButtonOnClickListener = onClickListener;
	}
	
	public void setNegativeButtonOnClickListener(DialogInterface.OnClickListener onClickListener) {
		this.nagativeButtonOnClickListener = onClickListener;
	}
	
	public android.app.Dialog onCreateDialog(Bundle savedInstanceState) {
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
		
		builder.setMessage(R.string.delete_warning_dialog_message)
		.setPositiveButton(R.string.picker_button_ok_text, positiveButtonOnClickListener)
		.setNegativeButton(R.string.picker_button_cacel_text, nagativeButtonOnClickListener);
		
		return builder.create();
	};
}
